﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Diagnostics;


using NHibernate;
using NHibernate.Cfg;
using NHibernate.Dialect;
using NHibernate.Driver;
using NHibernate.Mapping.ByCode;

using WebEx.Service;



namespace WebEx
{

    public partial class Default : System.Web.UI.Page
    {
        
        //const int MaxRow = 1000;
        //static ISessionFactory sessionFactory = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            ////Configuration config = new Configuration().Configure();

            if (Session["UserID"] != null)
            {
                int id = int.Parse(Session["UserID"].ToString());

                NHibernateHelper helper = new NHibernateHelper();
                ISession session = helper.GetSession();

                IList<string> userlist =  session.CreateQuery(string.Format(@"select UserName from User where UserID = {0}", id)).List<string>();
                if (userlist.Count > 0)
                {
                    this.HyperLink1.Text = "欢迎:" + userlist[0].ToString();
                }
            }

        }

        
    }
}
